using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;
using System.Text;

namespace WindowsApplication1
{
	/// <summary>
	/// Summary description for Course_Detail.
	/// </summary>
	public class Course_Detail : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Button btn_Save;
		private System.Windows.Forms.Button btn_Close;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;
		private System.Windows.Forms.RichTextBox txt_Course_Details;
		private System.Windows.Forms.OpenFileDialog openFileDialog1;
		private System.Windows.Forms.SaveFileDialog saveFileDialog1;
		private string course_name;
		public Course_Detail()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}
				public Course_Detail(string c_name)
				{
					//
					// Required for Windows Form Designer support
					//
					InitializeComponent();
					course_name=c_name;
		
		
					//
					// TODO: Add any constructor code after InitializeComponent call
					//
				}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.btn_Save = new System.Windows.Forms.Button();
			this.btn_Close = new System.Windows.Forms.Button();
			this.txt_Course_Details = new System.Windows.Forms.RichTextBox();
			this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
			this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
			this.SuspendLayout();
			// 
			// btn_Save
			// 
			this.btn_Save.Location = new System.Drawing.Point(176, 480);
			this.btn_Save.Name = "btn_Save";
			this.btn_Save.Size = new System.Drawing.Size(109, 30);
			this.btn_Save.TabIndex = 1;
			this.btn_Save.Text = "Save into file";
			this.btn_Save.Click += new System.EventHandler(this.btn_Save_Click);
			// 
			// btn_Close
			// 
			this.btn_Close.Location = new System.Drawing.Point(300, 480);
			this.btn_Close.Name = "btn_Close";
			this.btn_Close.Size = new System.Drawing.Size(95, 30);
			this.btn_Close.TabIndex = 2;
			this.btn_Close.Text = "Close";
			this.btn_Close.Click += new System.EventHandler(this.btn_Close_Click);
			// 
			// txt_Course_Details
			// 
			this.txt_Course_Details.Name = "txt_Course_Details";
			this.txt_Course_Details.Size = new System.Drawing.Size(632, 464);
			this.txt_Course_Details.TabIndex = 3;
			this.txt_Course_Details.Text = "";
			this.txt_Course_Details.TextChanged += new System.EventHandler(this.txt_Course_Details_TextChanged);
			// 
			// saveFileDialog1
			// 
			this.saveFileDialog1.FileName = "doc1";
			// 
			// Course_Detail
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(640, 557);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.txt_Course_Details,
																		  this.btn_Close,
																		  this.btn_Save});
			this.Name = "Course_Detail";
			this.Text = "Course_Detail";
			this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
			this.Load += new System.EventHandler(this.Course_Detail_Load);
			this.ResumeLayout(false);

		}
		#endregion

		private void Course_Detail_Load(object sender, System.EventArgs e)
		{
			
			
			switch(course_name)
			{
                

                case "MCAT":
                    txt_Course_Details.LoadFile("c:c\\Alpha\\PRIM\\WindowsApplication1\\coursedetails\\MCAT.rtf",RichTextBoxStreamType.RichText);
                break;

               

                case "GMAT":
                    txt_Course_Details.LoadFile("c:\\Alpha\\PRIM\\WindowsApplication1\\coursedetails\\GMAT.rtf", RichTextBoxStreamType.RichText);
                    break;

                

                case "GRE":
                    txt_Course_Details.LoadFile("c:\\Alpha\\PRIM\\WindowsApplication1\\coursedetails\\GRE.rtf", RichTextBoxStreamType.RichText);
                    break;
               

                    case "LSAT":
                        txt_Course_Details.LoadFile("c:\\Alpha\\PRIM\\WindowsApplication1\\coursedetails\\LSAT.rtf", RichTextBoxStreamType.RichText);
                    break;
                
                case "DAT":
                    txt_Course_Details.LoadFile("c:\\Alpha\\PRIM\\WindowsApplication1\\coursedetails\\DAT.rtf", RichTextBoxStreamType.RichText);
                    break;


			}
			
			
		
		}

		private void btn_Save_Click(object sender, System.EventArgs e)
		{
			
			switch(course_name)
			{
                
                case "MCAT":
                    txt_Course_Details.SaveFile("c:\\Alpha\\PRIM\\WindowsApplication1\\coursedetails\\MCAT.rtf", RichTextBoxStreamType.RichText);
                    MessageBox.Show("File Saved");
                    break;
                case "GMAT":
                    txt_Course_Details.SaveFile("c:\\Alpha\\PRIM\\WindowsApplication1\\coursedetails\\GMAT.rtf", RichTextBoxStreamType.RichText);
                    MessageBox.Show("File Saved");
                    break;
                case "GRE":
                    txt_Course_Details.SaveFile("c:\\Alpha\\PRIM\\WindowsApplication1\\coursedetails\\GRE.rtf", RichTextBoxStreamType.RichText);
                    MessageBox.Show("File Saved");
                    break;
                case "LSAT":
                    txt_Course_Details.SaveFile("c:\\Alpha\\PRIM\\WindowsApplication1\\coursedetails\\LSAT.rtf", RichTextBoxStreamType.RichText);
                    MessageBox.Show("File Saved");
                    break;
                case "DAT":
                    txt_Course_Details.SaveFile("c:\\Alpha\\PRIM\\WindowsApplication1\\coursedetails\\DAT.rtf", RichTextBoxStreamType.RichText);
                    MessageBox.Show("File Saved");
                    break;


			}					

		
		}
		private void btn_Close_Click(object sender, System.EventArgs e)
		{
		
			this.Dispose();
		
	
		}

		private void txt_Course_Details_TextChanged(object sender, System.EventArgs e)
		{
		
		}

	}

}
